﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Lswweb.Model
{
    /// <summary>
    /// Path字段，用“/”分隔路径级别
    /// </summary>
    public class CategoryInfo
    {
        private int _id;
        private string _title;
        private int _parentid = 0;
        private bool _status=true;
        private int _displayorder = 0;
        private string _path;

        /// <summary>
        /// 
        /// </summary>
        public int Id
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Title
        {
            set { _title = value; }
            get { return _title; }
        }

        /// <summary>
        /// 
        /// </summary>
        public int ParentId
        {
            set { _parentid = value; }
            get { return _parentid; }
        }
        /// <summary>
        /// 
        /// </summary>
        public bool Status
        {
            set { _status = value; }
            get { return _status; }
        }
        /// <summary>
        /// 
        /// </summary>
        public int DisplayOrder
        {
            set { _displayorder = value; }
            get { return _displayorder; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Path
        {
            set { _path = value; }
            get { return _path; }
        }

        public string Ver { get; set; }

        private int depth = 0;
        public int Depth
        {
            get
            {
                if (depth == 0 && !string.IsNullOrEmpty(Path))
                    depth = Path.Split('/').Length;
                return depth;
            }
        }

        public string Icon { get; set; }

        public string Description { get; set; }
    }

    public enum TreeTableType
    {
        NewsCategories=1,
        ProductCategories=2,
        LinkCategories=3,
        UpFileCategories=4,
        Cities=5,
        Brand=6
    }
}
